import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import Task from '../views/task'
import TaskDetail from '../views/task/detail'
import TaskPilot from '../views/order/detail/pilot'

import OrderDetail from '../views/order/detail'

import Order from '../views/order'
import Home from '../views/home'
import Mine from '../views/mine'
import Login from '../views/login'
import Register from '../views/register'
import Industry from '../views/home/detail/industry'
import Create from '../views/order/add'
import VMap from '../views/order/add/map'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'red',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/order',
    name: 'order',
    component: Order
  },
  {
    path: '/task',
    name: 'task',
    component: Task
  },
  {
    path: '/mine',
    name: 'mine',
    component: Mine
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/orderDetail/:id',
    name: 'orderDetail',
    component: OrderDetail
  },
  {
    path: '/taskDetail/:id',
    name: 'taskDetail',
    component: TaskDetail
  },
  {
    path: '/taskPilot/:id',
    name: 'taskPilot',
    component: TaskPilot
  },
  {
    path: '/industry/:id',
    name: 'industry',
    component: Industry
  },
  {
    path: '/create/:pid/:id',
    name: 'create',
    component: Create
  },
  {
    path: '/map',
    name: 'map',
    component: VMap
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
